package com.cskaoyan.controller.wx;

import com.cskaoyan.bean.common.BaseRespVo;
import com.cskaoyan.bean.vo.wx.HomeIndexVO;
import com.cskaoyan.service.wx.HomeService;
import org.apache.tomcat.util.http.ResponseUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @Description
 * @Author klw
 * @Data 2022/11/22 上午10:33
 * 首页商品展示
 */

@RestController
@RequestMapping("wx/home")
public class HomeController {

    @Autowired
    HomeService homeService;

    @GetMapping("index")
    public BaseRespVo index(){
        HomeIndexVO homeIndexVO = homeService.listHomeIndex();

        return BaseRespVo.ok(homeIndexVO);
    }


    @GetMapping("/about")
    public BaseRespVo about() {
        Map<String, Object> about = homeService.getAbout();

        return BaseRespVo.ok(about);
    }
}
